package it.free.i.virtual.machine.hal.devicealias.echo;

import it.free.i.virtual.machine.hal.devicealias.laboratory.simulator.dynamicparameter.Levels;
import it.free.i.virtual.swarm.ComposableInformationUnit;
import it.free.i.virtual.swarm.ComposableInformationUnit.CIUGeneratorAllowedOperations;

/**  
 * Dynamic parameter changing event echo DTO
 * @author stefano
 */
public class DynamicParameterChangingEchoImpl extends EchoImpl implements DynamicParameterChangingEcho {
	
	private Levels myLevel = null;
	private String myDynamicParameterName = null;
	
	public DynamicParameterChangingEchoImpl(){
		super();
	}

	/**
	 * @return the dynamic parameter name
	 */
	public String getDynamicParameterName() {
		return this.myDynamicParameterName;
	}

	/**
	 * @return the level the dynamic parameter has now
	 */
	public Levels getLevel() {
		return this.myLevel;
	}

	/**
	 * @param dynamicParameterName is the name of the dynamic parameter changing
	 */
	public void setDynamicParameterName(String dynamicParameterName) {
		this.myDynamicParameterName = dynamicParameterName;
	}

	/**
	 * @param level is the level the dynamic parameter has now
	 */
	public void setLevel(Levels level) {
		this.myLevel = level;
	}

	public ComposableInformationUnit getRenderedObjectImage() {

		ComposableInformationUnit composableInformationUnit = ComposableInformationUnit.Factory.createObject();
		
		composableInformationUnit.setAttribute("level", this.myLevel.toString());
		composableInformationUnit.setAttribute("dynamicParameterName", this.myDynamicParameterName);
		composableInformationUnit.setAllowedOperations(CIUGeneratorAllowedOperations.READ);
		
		composableInformationUnit.setCiuType(this.getClass().getName());
		
		return composableInformationUnit;
	}
}
